<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>

<form action="<?php echo url_for('user/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table class="form">
    <tfoot>
      <tr>
        <td colspan="2" style="text-align:center;">
          <?php echo $form->renderHiddenFields() ?>
          <a class="btn darkblue" href="<?php echo url_for('user/index') ?>">Cancelar</a>
          <?php if (!$form->getObject()->isNew()): ?>
            <?php echo link_to('Remover', 'user_delete', $form->getObject(), array('class' => 'btn darkblue', 'method' => 'delete', 'confirm' => 'Voc&ecirc; tem certeza?')) ?>
          <?php endif; ?>
          <input class="submit_btn darkblue" type="submit" value="Salvar" />
        </td>
      </tr>
    </tfoot>
    <tbody>
    <?php echo $form->renderGlobalErrors() ?>
    <?php if (isset($form['username'])) : ?>
      <tr>
        <th><?php echo $form['username']->renderLabel() ?></th>
        <td>
          <?php echo $form['username'] ?>
        </td>
        <td>
          <?php echo $form['username']->renderError() ?>
        </td>
      </tr>
    <?php endif; ?>
    <?php if (isset($form['password'])) : ?>
      <tr>
        <th><?php echo $form['password']->renderLabel() ?></th>
        <td>
          <?php echo $form['password'] ?>
        </td>
        <td>
          <?php echo $form['password']->renderError() ?>
        </td>
      </tr>
    <?php endif; ?>
    <?php if (isset($form['password_again'])) : ?>
      <tr>
        <th><?php echo $form['password_again']->renderLabel() ?></th>
        <td>
          <?php echo $form['password_again'] ?>
        </td>
        <td>
          <?php echo $form['password_again']->renderError() ?>
        </td>
      </tr>
    <?php endif; ?>
    <?php if (isset($form['first_name'])) : ?>
      <tr>
        <th><?php echo $form['first_name']->renderLabel() ?></th>
        <td>
          <?php echo $form['first_name'] ?>
        </td>
        <td>
          <?php echo $form['first_name']->renderError() ?>
        </td>
      </tr>
    <?php endif; ?>
    <?php if (isset($form['last_name'])) : ?>
      <tr>
        <th><?php echo $form['last_name']->renderLabel() ?></th>
        <td>
          <?php echo $form['last_name'] ?>
        </td>
        <td>
          <?php echo $form['last_name']->renderError() ?>
        </td>
      </tr>
    <?php endif; ?>
    <?php if (isset($form['birthday'])) : ?>
      <tr>
        <th><?php echo $form['birthday']->renderLabel() ?></th>
        <td>
          <?php echo $form['birthday'] ?>
        </td>
        <td>
          <?php echo $form['birthday']->renderError() ?>
        </td>
      </tr>
    <?php endif; ?>
    <?php if (isset($form['email'])) : ?>
      <tr>
        <th><?php echo $form['email']->renderLabel() ?></th>
        <td>
          <?php echo $form['email'] ?>
        </td>
        <td>
          <?php echo $form['email']->renderError() ?>
        </td>
      </tr>
    <?php endif; ?>
    <?php if (isset($form['home_phone'])) : ?>
      <tr>
        <th><?php echo $form['home_phone']->renderLabel() ?></th>
        <td>
          <?php echo $form['home_phone'] ?>
        </td>
        <td>
          <?php echo $form['home_phone']->renderError() ?>
        </td>
      </tr>
    <?php endif; ?>
    <?php if (isset($form['cel_phone'])) : ?>
      <tr>
        <th><?php echo $form['cel_phone']->renderLabel() ?></th>
        <td>
          <?php echo $form['cel_phone'] ?>
        </td>
        <td>
          <?php echo $form['cel_phone']->renderError() ?>
        </td>
      </tr>
    <?php endif; ?>
    <?php if (isset($form['is_active'])) : ?>
      <tr>
        <th><?php echo $form['is_active']->renderLabel() ?></th>
        <td>
          <?php echo $form['is_active'] ?>
        </td>
        <td>
          <?php echo $form['is_active']->renderError() ?>
        </td>
      </tr>
    <?php endif; ?>
    <?php if (isset($form['is_super_admin'])) : ?>
      <tr>
        <th><?php echo $form['is_super_admin']->renderLabel() ?></th>
        <td>
          <?php echo $form['is_super_admin'] ?>
        </td>
        <td>
          <?php echo $form['is_super_admin']->renderError() ?>
        </td>
      </tr>
    <?php endif; ?>
    </tbody>
  </table>
</form>
